package com.lovo.dao;

import com.lovo.bean.Book;
import com.lovo.bean.Type;
import com.lovo.provider.BookProvider;
import com.lovo.provider.TypeProvider;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.SelectProvider;

import java.util.List;

public interface BookMapper {
    int deleteByPrimaryKey(Integer bookId);

    int insert(Book record);

    int insertSelective(Book record);

    Book selectByPrimaryKey(Integer bookId);

    int updateByPrimaryKeySelective(Book record);

    int updateByPrimaryKey(Book record);

    @SelectProvider(type = BookProvider.class,method = "getBooksById")
    @ResultMap("com.lovo.mapper.BookMapper.BookMap")
    public List<Book> getBooksByTypeId(int typeId);
}